#ifndef SCENE_H
#define SCENE_H

#include <QObject>
#include <vector>
#include "camera.h"
#include "object.h"
#include "light.h"
#include "trio.h"


class Scene : public QObject{
	Q_OBJECT

    public:
        Scene();
        ~Scene();

        Camera *getCamera(){return camera;};
        Light *getLight(){return light;};
        void addObject(Object *);
        Object *getObject(unsigned int) const;
        unsigned int getObjectsSize() const;
        void deleteObject(Object *);
        int nextObjectsID();
        void setNextObjectsID(int);

        void draw(bool, bool, bool);

        void changeDepth(int _d) {depth = _d;};
        void doRaytracing();
        void testRaytracing(const Ray &);
        void clearTestRay(){listOfPoints.clear();};


    private:
        Light *light;
        Camera *camera;
        std::vector<Object *> objects;
        std::vector<Trio> listOfPoints;

        int idObjects;
        int depth;
        double *raytracing(const Ray &, unsigned int);
        void drawRay();

    signals:
        void setLine(unsigned int, uchar *);
};

#endif
